package 基础语法;

public class 静态代码块 {
    public static void main(String[] args) {
        staticCode staticCode=new staticCode();//随着类的第一次加载而执行一次
        staticCode staticCod1e=new staticCode();//不执行
        staticCode2.aa();//执行
    }
    
}
class staticCode{
    static{
        System.out.println("LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLl");
    }
}
class staticCode2{
    static{
        System.out.println("staticCode2staticCode2staticCode2staticCode2staticCode2staticCode2");
    }
    public static void aa(){
        System.out.println("aaaaaaaaaa");
    }
}

